<?php
/**
 * The template for displaying search results pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
 *
 * @package WordPress
 * @subpackage Twenty_Seventeen
 * @since 1.0
 * @version 1.0
 */

get_header(); ?>

<div class="inner">

	<header class="page-header">
		<?php if ( have_posts() ) : ?>
			<h1 class="page-title"><?php printf( '搜索：%s', '<span>' . get_search_query() . '</span>' ); ?></h1>
		<?php else : ?>
			<h1 class="page-title">什么都没有搜到</h1>
		<?php endif; ?>
	</header><!-- .page-header -->

	<main id="main" class="site-main" role="main">

	<?php
	if ( have_posts() ) :
		/* Start the Loop */
		while ( have_posts() ) : the_post();

			/**
			 * Run the loop for the search to output the results.
			 * If you want to overload this in a child theme then include a file
			 * called content-search.php and that will be used instead.
			 */
			get_template_part( 'parts/content', 'excerpt' );

		endwhile; // End of the loop.

		the_posts_pagination( array(
			'prev_text' => '&lt; 上一页',
			'next_text' => '下一页 &gt;',
			'before_page_number' => '<span class="meta-nav screen-reader-text">页码 </span>',
		) );

	else : ?>

		<p>对不起，没有搜索到您要的，请尝试搜索其他关键字</p>
		<?php
			get_search_form();

	endif;
	?>

	</main><!-- #main --><!-- #primary -->
	<?php get_sidebar(); ?>
</div><!-- .wrap -->

<?php get_footer();
